package gmail.zxm.dubboz1jdglweb.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import d.z1.api.customer.ICustomerService;
import d.z1.entity.CustomerInfo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/customer")
public class CustomerService {

    @Reference
    private ICustomerService iCustomerService;

    @RequestMapping("/getAll")
    public List<CustomerInfo> getAll() throws Exception {
        System.out.println(iCustomerService);
        return iCustomerService.selectAll();
    }

    @RequestMapping("/getId/{id}")
    public CustomerInfo getId(@PathVariable Integer id) throws Exception {
        System.out.println(id);
        return iCustomerService.selectId(id);
    }
}
